package com.Yukiha.gachamod.util;


import com.Yukiha.gachamod.GachaMod;
import com.Yukiha.gachamod.item.ModItems;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@SuppressWarnings("removal")
public class ModCreativeTab {

    public static final DeferredRegister<CreativeModeTab> TABS =
            DeferredRegister.create(Registries.CREATIVE_MODE_TAB, GachaMod.MODID);

    public static final RegistryObject<CreativeModeTab> GACHA_TAB = TABS.register("gacha_tab", () ->
            CreativeModeTab.builder()
                    .title(Component.literal("抽卡模组"))
                    .icon(() -> new ItemStack(ModItems.RARE_TICKET.get()))
                    .displayItems((params, output) -> {
                        output.accept(ModItems.COMMON_TICKET.get());
                        output.accept(ModItems.RARE_TICKET.get());
                        output.accept(ModItems.EPIC_TICKET.get());
                        output.accept(ModItems.LEGENDARY_TICKET.get());
                    })
                    .build()
    );

    public static void register() {
        TABS.register(FMLJavaModLoadingContext.get().getModEventBus());
    }
}
